﻿@model IEnumerable<TeamOPSchoolCup.Domain.POCO.Result>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<h3>Results by S1</h3>
<ul>
@foreach (TeamOPSchoolCup.Domain.POCO.Result r in ViewBag.ResultsByStudent)
{
    <li>@r.ResultScore in @r.Event.Name</li>
}
</ul>

<h3>Results in 100m baksteenslag</h3>
<ul>
@foreach (TeamOPSchoolCup.Domain.POCO.Result r in ViewBag.ResultsByEvent)
{
    <li>@r.ResultScore by @r.TeamMembership.Student.Member.Name</li>
}
</ul>

<h3>Results by De Snelle Eddies</h3>
<ul>
@foreach (TeamOPSchoolCup.Domain.POCO.Result r in ViewBag.ResultsByTeam)
{
    <li>@r.ResultScore by @r.Event.Name</li>
}
</ul>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            ResultScore
        </th>
        <th>
            IsOfficial
        </th>
        <th>
            Event
        </th>
        <th>
            Student
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.ResultScore)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.IsOfficial)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Event.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TeamMembership.Student.Member.Name)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ResultId }) |
            @Html.ActionLink("Details", "Details", new { id=item.ResultId })
        </td>
    </tr>
}

</table>
